import { Component, OnInit } from '@angular/core';

@Component({
  selector: '[app-servers]',
  template:`
	<app-server></app-server>
	<app-server></app-server>
  `,
  templateUrl: './servers.component.html',
  styleUrls: ['./servers.component.css','../../../node_modules/bootstrap/dist/css/bootstrap.min.css']
  // styleUrls: ['./servers.component.css']
})
export class ServersComponent implements OnInit {

  allowNewServer = false;
  serverCreationStayus="mmmm";
  serverName='ttt';
  serverCreated=false;
  servers=['ServerTest1','ServerTest2'];

  constructor() { 
    setTimeout(()=>{
      this.allowNewServer = true;
    },2000)
  }

  ngOnInit() {
  }

  onCreateServer(){
    this.serverCreated=true;
    this.serverCreationStayus="nnnn";
    this.servers.push(this.serverName);
  }
  onUpdateServerName(event:any){
    // console.log(event)
    this.serverName=(<HTMLInputElement>event.target).value;
  }//进行强制说明

}
